Skip to content

[gc_fuzz]: Extend everything we have done so far to array types#13847

Merged
fitzgen merged 2 commits into
bytecodealliance:mainfrom
khagankhan:array
Jul 21, 2026
Merged

[gc_fuzz]: Extend everything we have done so far to array types#13847
fitzgen merged 2 commits into
bytecodealliance:mainfrom
khagankhan:array

Conversation

@khagankhan

Copy link
Copy Markdown
Contributor
  • types.rs: CompositeType::Array with a reused StructField element. Full array-to-array subtyping (element covariance/invariance, forced element-compatibility in fixup). Cross-kind supertype edges (struct<->array) are cleared. StackType::Array wired into operand satisfaction, eqref upcast, and cast repair.
  • ops.rs: a full mirror of the struct op family for arrays, plus array-specific ArrayNew (fixed-length array.new_default), ArrayGet/ArraySet, and ArrayLen. Accesses are null-guarded and use index % (array_length + 1) so out-of-bounds traps are exercised but rare. A same-kind index remap keeps struct ops off array types (and vice versa) now that both share one type-index space.
  • mutator.rs: array generation, element mutation, and generic rec-group duplication.
  • oracles.rs: take_array + typed take_array_N imports, and Trap::ArrayOutOfBounds added to the accepted-trap allowlist.
  • limits.rs: a fuzzable array_length knob (1..=16, default 5).
  • config.rs: Config::to_store() could panic in Engine::new() for pooling + GC configs. The GC-heap backing memory rounds its minimum size up to a 64 KiB wasm page, but the harness clamped gc_heap_initial_size to max_memory_size in raw bytes — so a non-page-aligned max_memory_size let the rounded-up minimum overshoot the pool's per-memory limit, and Engine::new (correctly) rejected the config, which to_store().unwrap() turned into a crash. Fixed by clamping the initial size to max_memory_size rounded down to a page.

+cc @fitzgen @eeide

@khagankhan
khagankhan requested a review from a team as a code owner July 8, 2026 21:52
@khagankhan
khagankhan requested review from alexcrichton and removed request for a team July 8, 2026 21:52
@alexcrichton
alexcrichton requested review from fitzgen and removed request for alexcrichton July 8, 2026 22:20
@github-actions github-actions Bot added the fuzzing Issues related to our fuzzing infrastructure label Jul 9, 2026
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Subscribe to Label Action

cc @fitzgen

Details This issue or pull request has been labeled: "fuzzing"

Thus the following users have been cc'd because of the following labels:

  • fitzgen: fuzzing

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@fitzgen fitzgen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM, just needs a rebase

@khagankhan

Copy link
Copy Markdown
Contributor Author

@fitzgen Thanks! I rebased it and considering this PR solved the bug in config.rs I resolved the conflict accordingly.

@fitzgen fitzgen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@fitzgen
fitzgen added this pull request to the merge queue Jul 21, 2026
Merged via the queue into bytecodealliance:main with commit b1988f9 Jul 21, 2026
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fuzzing Issues related to our fuzzing infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants